<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>动态关闭网页</title>
    <script type="text/javascript">
//关闭窗口
    function closeWin() {
        window.close();           //调用window对象的close()函数,关闭窗口
    }
    </script>

</head>
<body style="text-align: center">
<p>
    <!--定义前进和后退的按钮-->
    <input type="button" value="关闭此窗口" onclick="closeWin()"/>


</p>

</body>
</html>